import { request } from '../request';
import { UserInfo, LoginParams, LoginResult } from '../types';

// 获取用户信息
export const fetchUserInfo = (userId: number) => {
  return request.get<UserInfo>({
    url: `/users/${userId}`,
  });
};

// 用户登录
export const userLogin = (data: LoginParams) => {
  return request.post<LoginResult, LoginParams>({
    url: '/auth/login',
    data,
    // skipToken: true, // 登录接口不需要携带token
  });
};